package com.example.shellshopping.YCB_settings;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.example.shellshopping.R;

public class YCBSettingsTongyongActivity extends AppCompatActivity {

    ImageView back,one;
    Button btn1;
    int changeStyle = 0;
    private void setListener() {
        back.setOnClickListener(onClickListener);
        btn1.setOnClickListener(onClickListener);
    }

    private void initView() {
        back = findViewById(R.id.ycb_settings_tongyong_back);
        btn1 = findViewById(R.id.ycb_settings_tongyong_btn1);
        one = findViewById(R.id.ycb_settings_tongyong_one_selected);
    }

    View.OnClickListener onClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.ycb_settings_tongyong_back:
                    finish();
                    break;
                case R.id.ycb_settings_tongyong_btn1:
                    changeStyle();
                    break;
            }
        }
    };

    private void changeStyle() {
        if (changeStyle == 0) {
            one.setVisibility(View.VISIBLE);
            changeStyle = 1;
        }else{
            one.setVisibility(View.INVISIBLE);
            changeStyle = 0;
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ycb_settings_tongyong_activity);
        initView();
        setListener();
    }
}